﻿using cszmcaux;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Reflection.Metadata;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace _1_ZmotionDev
{
    public partial class SerialPortForm : Form
    {
        private IntPtr handle;

        public SerialPortForm()
        {
            InitializeComponent();
        }

        private void Btn_Connect_Click(object sender, EventArgs e)
        {
            // 调用方法连接控制器
            int result = Zmcaux.ZAux_OpenCom(5, out handle);
            // 判断是否连接成功
            if (result == 0)
            {
                MessageBox.Show("连接控制器成功");
            }
            else
            {
                MessageBox.Show("连接控制器失败");
            }
        }
    }
}
